<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * FormativeLab
 *
 * An open source application development framework for PHP 5.1.6 or newer
 *
 * @package		FormativeLab
 * @author		FormativeLab Dev Team
 * @copyright	Copyright (c) 2011 - 2013, FormativeLab, Inc.
 * @license		http://www.formativesoft.com/license/
 * @link		http://www.formativesoft.com/
 * @since		Version 2.0
 * @filesource ./application/controllers/Access.php
 */

// ------------------------------------------------------------------------

/**
 * FormativeLab Access Controller
 *
 * @package		FormativeLab
 * @subpackage	controllers
 * @category	controllers
 * @author		Formative Soft Ltd
 * @link		http://www.formativesoft.com/
 */

// ------------------------------------------------------------------------

class Access extends FSL_Controller {

	static $helpesr	= array();
	static $models	= array('M00I001');

	public function __construct(){
        parent::__construct('defaults');
		$this->load->helper(self::$helpers);
		$this->load->model(self::$models);
    }
		
	public function index(){
		//$this->load->view('rest/index');
		$this->auth->logout();
		//$this->auth->preAuthenticated();
		echo 'hello';
	}
	
	public function create(){
		if(isPostRequest($this)){	
			$response = array(
				'success' => true,
				'message' => 'save'
			);
			jsonDataRender($response);
		}
	}
	
	public function read(){
		if($this->auth->isAuthorizedGetRequest('sys')){	
			if(isGetRequest($this)){
				$response = array(
					'success' => true,
					'message' => 'read'
				);
				jsonDataRender($response);
			}
		}
		//$this->auth->output();
	}
	
	public function update(){
		if(isPutRequest($this)){
			$response = array(
				'success' => true,
				'message' => 'update'
			);			
			jsonDataRender($response);
		}
	}
	
	public function destroy(){
		if(isDeleteRequest($this)){
			$response = array(
				'success' => true,
				'message' => 'destory'
			);
			jsonDataRender($response);
		}
	}	
}

/* End of file Access.php */
/* Location: ./application/controllers/Access.php */